﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Library;
using Microsoft.Xna.Framework;

namespace SimulationGame
{
	public class Tile:Sprite
	{
		public enum Type { Hard, Air, Water };
		public List<Item> contents = new List<Item>();
		public Type type;
		public bool marked = false;
		public int health = 10;

		public Tile(string texturePath,Type type):base(texturePath,32,32,true,1)
		{
			this.type = type;
		}
		public void Mark(bool drawing)
		{
			if (marked && !drawing)
			{
				marked = false;
				color = Color.White;
			}
			else if (type != Type.Air && drawing)
			{
				marked = true;
				color = Color.Red;
			}
		}
		public void Mine(Equipment equipment)
		{
			if (equipment == null)
			{
				health--;
			}
			if (health <= 0)
			{
				type = Type.Air;
			}
		}
	}
}
